/**
 * @Author: linzp
 * @Date: 2021/11/09/16:42
 */
import java.util.Stack;
public class stack_demo {



    public class Solution {

        Stack<Integer> normalstack = new Stack<Integer>();
        Stack<Integer> minstack = new Stack<Integer>();

        public void push(int node) {
            normalstack.push(node);
            if(minstack.isEmpty() || node <= minstack.peek()){
                minstack.push(node);
            }
        }

        public void pop() {
            if(normalstack.pop() == minstack.peek()){
                minstack.pop();
            }
        }

        public int top() {
            return normalstack.peek();
        }

        public int min() {
           return minstack.peek();
        }
    }
}
